<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>02.准备一个效果</title>
    <!-- 引入Vue -->
    <script type="text/javascript" src="../../js/vue.js"></script>
  </head>
  <body>
    <!-- 准备好一个容器-->
    <div id="demo">
      <h1>人员信息</h1>
      <h3>姓名：{{personName}}</h3>
      <h3>年龄：{{personAge}}</h3>
      <button @click="showPerson">点我提示个人信息</button>
      <hr>
      <h1>学校信息</h1>
      <h3>校名：{{schoolName}}</h3>
      <h3>地址：{{schoolAddress}}</h3>
      <button @click="showSchool">点我提示学校信息</button>
    </div>

    <script type="text/javascript">
      new Vue({
        el:'#demo',
        data:{
          personName:'小橙子',
          personAge:18,
          schoolName:'尚硅谷',
          schoolAddress:'宏福科技园'
        },
        methods:{
          showPerson(){
            alert(`我叫${this.personName}，我今天${this.personAge}岁了`)
          },
          showSchool(){
            alert(`${this.schoolName}坐落于${this.schoolAddress}`)
          }
        }
      })
    </script>
  </body>
</html>